/*
 * fImageButton.h
 *
 *  Created on: 2011-3-17
 *      Author: wangchao
 */

#ifndef fImageButton_H_
#define fImageButton_H_

#include "fFramework.h"
#include "fBaseControl.h"

class fImageButton;
class fImageButtonObserver
{
public:
    virtual void ImageButtonClicked( fImageButton* button ) = 0;
};

class fImageButton : public fControlBase
{
public:
    ~fImageButton();
    static fImageButton *NewL( fEngine * aEngine );
    static fImageButton *NewLC( fEngine * aEngine );
private:
    fImageButton();
    void ConstructL( fEngine * aEngine );
public:
    virtual void RenderFrame();
    virtual void HandleKey( f_KEY_DES * aKeyDes );
    virtual TInt HandleMouse( fMouseEvent nType, TPoint sPoint );
public:
    fImage* _foreNormal;
    fImage* _foreHilite;
    fImage* _forePushed;
public:
    fImageButtonObserver* _observer;
private:
    TPoint _ptPosition;
    bool _layout;
protected:
    void layout();
private:
    enum EImageButtonState
    {
        //
        EPushed,
        ENormal,
        EHilite,
    };

    EImageButtonState _state;

};
#endif /* fImageButton_H_ */
